package algorithm.interview;

import java.util.Scanner;

//兔子繁殖
public class RabbitGrow{

 public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  System.out.println("请输入第几个月：");
  int n = sc.nextInt();
  System.out.println("这个月兔子有" +rabbitNum(n)+"对。");

 }

  // 每个月的兔子多少对。
  private static int rabbitNum(int n){

   if(n <3){ return 1;}

   return rabbitNum(n -1) + rabbitNum(n-2);
 }

}